home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / lib / udev / create_static_nodes < prev    next >
Encoding:
Text File  |  2010-12-12  |  616 b   |  32 lines

  1. #!/bin/sh -e
  2.  
  3. make_extra_nodes() {
  4.   [ -e /etc/udev/links.conf ] || return 0
  5.  
  6.   grep '^[^#]' /etc/udev/links.conf | \
  7.   while read type name arg1; do
  8.     [ "$type" -a "$name" -a ! -e "/$1/$name" -a ! -L "/$1/$name" ] || continue
  9.     case "$type" in
  10.       L) ln -s $arg1 /$1/$name ;;
  11.       D) mkdir -p /$1/$name ;;
  12.       M) mknod -m 600 /$1/$name $arg1 ;;
  13.       *) echo "links.conf: unparseable line ($type $name $arg1)" >&2 ;;
  14.     esac
  15.  
  16.     if [ -x /sbin/restorecon ]; then
  17.       /sbin/restorecon /dev/$name
  18.     fi
  19.   done
  20. }
  21.  
  22. if [ "$1" ]; then
  23.   devdir="$1"
  24. else
  25.   devdir='/dev'
  26. fi
  27.  
  28. make_extra_nodes $devdir
  29.  
  30. exit 0
  31.  
  32.